/*
 * @Author: lixinke 530822237@qq.com
 * @Date: 2022-08-16 00:56:56
 * @LastEditors: lixinke 530822237@qq.com
 * @LastEditTime: 2022-08-16 01:08:41
 * @FilePath: \新建文件夹 (3)\crm_customer\src\store\orderStroe.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import {makeAutoObservable} from 'mobx'
import service from './../service'
class orderStroe{
    constructor(){
        makeAutoObservable(this);
    }
    get order(){
         if(sessionStorage.getItem('order')){
            return JSON.parse(sessionStorage.getItem('order'));
         }
         return{};
    }
    set order(data){
        sessionStorage.setItem('order',JSON.stringify(data));

    }
    // get token(){
    //     if(sessionStorage.getItem('token')){
    //         return sessionStorage.getItem('token');
    //      }
    //      return "";
    // }
    // set token(value){
    //     sessionStorage.setItem('token',value);
    // }
    getorder=()=>{
        return new Promise((resolve,reject)=>{
            service.orderservice.Order_list()

        });
    }
}
export default orderStroe;